<script setup lang="ts">
import { ref, toRefs } from "vue";
import { onShow, onHide, onLoad } from "@dcloudio/uni-app";
import _ from "lodash";

let props = defineProps(["label", "text", "light", "styleOpt"]);
let { label, text, light, styleOpt } = toRefs(props);
</script>

<template>
  <div class="form-item">
    <span
      :class="light ? 'name name-light' : 'name'"
      :style="_.assign({}, styleOpt)"
      >{{ label }}</span
    >
    <span class="search-input">
      {{ text }}
    </span>
    <div>
      <slot></slot>
    </div>
  </div>
</template>

<style lang="less" scoped>
.form-item {
  display: flex;
  align-items: center;
  flex-direction: row;
  height: 112rpx;
}
.name {
  font-family: PingFangSC, PingFang SC;
  font-weight: bold;
  font-size: 32rpx;
  color: #333333;
  padding-right: 8rpx;
  padding-left: 34rpx;
}

.name-light {
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 32rpx;
  color: #333333;
}

.search-input {
  height: 100%;
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 30rpx;
  color: #333333;
  flex: 1;
  box-sizing: border-box;
  padding-right: 30rpx;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
</style>
